package com.hudsonmq.spring.utils;

import com.hudson.core.concurrent.threadpool.HudsonThreadFactory;
import com.hudson.core.concurrent.threadpool.TimerScheduledThreadPool;
import com.hudson.core.concurrent.threadpool.TimerThreadPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

public class ThreadPoolHelper {
    private static final Logger logger = LoggerFactory.getLogger(ThreadPoolHelper.class);



    public static TimerScheduledThreadPool DEFAULT_SCHEDULED_POOL = new TimerScheduledThreadPool("consume-default-scheduled-pool",
            2, new HudsonThreadFactory("default-scheduled"));

    public static TimerThreadPool DEFAULT_THREAD_POOL = new TimerThreadPool(
            "consume-default-thread-pool", 2, 4, 30, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new HudsonThreadFactory("default-scheduled"));

//    public static HashedWheelTimer WHEEL_TIMER = new HashedWheelTimer(
//            new HudsonThreadFactory("consume-relay-message-thread"), 1, TimeUnit.SECONDS);

}
